package com.yukh.framework.base.net.socket.demo1;

import java.io.IOException;
import java.net.ServerSocket;

public class MyServer {

	public static void main(String[] args) throws IOException {
		ServerSocket server = new ServerSocket(12345);		
		String host = server.accept().getInetAddress().getHostAddress();
		String hostName = server.accept().getInetAddress().getHostName();
		System.out.println(host + "===" + hostName);
//		Socket client = server.accept();
//		BufferedReader in = new BufferedReader(new InputStreamReader(client
//				.getInputStream()));
//		PrintWriter out = new PrintWriter(client.getOutputStream());
//		while (true) {
//			String str = in.readLine();
////			System.out.println(str);
//			out.println("message have received");
//			out.flush();
//			if (str.equals("end"))
//				break;
//		}
//		client.close();
	}
}
